package com.example.ailiyuncloud.controller;

import com.example.ailiyuncloud.pojo.SocketPojo;
import com.example.ailiyuncloud.service.SocketService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: lqj
 * @Date: 2024/05/21/14:49
 * @Description:
 */
@RestController
@RequestMapping("/socket")
public class SocketController {

    @Autowired
    private SocketService socketService;

    @PostMapping("/sending")
    public Object getSocket(@RequestBody SocketPojo socketPojo) {
       return socketService.socketCustom(socketPojo.getUsername(), socketPojo.getMessage());
    }
}
